import request from '../utils/request';
// let baseURL = 'http://192.168.20.35:8866';
let baseURL = '';


export function getMachList(data={}){
    return request.get('/equipment/api/meter/getMeter', { data, baseURL, noprefix:true }).catch(err=>console.log(err)); 
}

export function getMachTypes(data={}){
    return request.get('/equipment/api/meter/getMeterType', { data, baseURL, noprefix:true }).catch(err=>console.log(err)); 
}

export function getModelList(data={}){
    return request.get('/equipment/api/meter/getMeterModelList', { data, baseURL, noprefix:true }).catch(err=>console.log(err)); 
}

export function addMach(data = {}){
    return request.post('/equipment/api/meter/addMeter', { data }, { noprefix:true }).catch(err=>console.log(err));
}

export function updateMach(data = {}){
    return request.put('/equipment/api/meter/updateMeter', { data, baseURL }, { noprefix:true }).catch(err=>console.log(err)); 
}

export function delMach(data = {}){
    return request.delete('/equipment/api/meter/deleteMeter', { data, noprefix:true, transformToJson:true }).catch(err=>console.log(err));
}

export function getMachParams(data={}){
    return request.get('/equipment/api/meter/getMetrics', { data, baseURL, noprefix:true }).catch(err=>console.log(err)); 
}



export function getMachRunningInfo(data={}){
    return request.get('/equipment/api/operationMonitoring/getMeterRunInfo', { data, baseURL, noprefix:true }).catch(err=>console.log(err)); 
}

export function getMachEffInfo(data={}){
    return request.get('/equipment/api/analyseCenter/getEnergyEfficiencyAnalysis', { data, baseURL, noprefix:true }).catch(err=>console.log(err)); 
}

export function getMachParamInfo(data={}){
    return request.get('/equipment/api/operationMonitoring/getMeterMetricsInfo', { data, baseURL, noprefix:true }).catch(err=>console.log(err)); 
}

export function getMachSimulutionInfo(data={}){
    return request.get('/client/api/analyseCenter/getFitAnalysis', { data, baseURL, noprefix:true }).catch(err=>console.log(err)); 
}

export function getCustomDate(data={}){
    return request.get('/equipment/api/analyseCenter/getDateZone', { data, baseURL, noprefix:true }).catch(err=>console.log(err)); 
}